package cn.intotw.rdcj.admin.controller;

import cn.intotw.rdcj.core.bean.DataResponse;
import cn.intotw.rdcj.core.bean.Result;
import cn.intotw.rdcj.core.constant.Constants;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

/**
 * Created by Chenxiang
 *
 * @generator: IntelliJ IDEA
 * @description: 测试权限Controller
 * @project: rdcj
 * @package: cn.intotw.rdcj.admin.controller
 * @date: 2021年06月02日 16时26分
 */
@RestController
@RequestMapping("/test")
@RequiresRoles(value = "admin")
@Slf4j
public class TestRolesController {
    @PostMapping("/test1")
    public ModelAndView testRole(){
        return new ModelAndView(Constants.JSON_DATA_VIEW, DataResponse.successWithResult(null));
    }
    @PostMapping("/test2")
    public ModelAndView testRole2(){
        return new ModelAndView(Constants.JSON_DATA_VIEW, DataResponse.successWithResult(null));
    }
    @GetMapping("/test3")
    public ModelAndView testRole3(){
        log.info("test3");
        return new ModelAndView(Constants.JSON_DATA_VIEW, DataResponse.successWithResult(null));
    }
}
